﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.WindowsAzure.StorageClient;
using Microsoft.WindowsAzure;

namespace Inverter
{
    class IndexContext : TableServiceContext
    {
        public IndexContext(string baseAddress,
            StorageCredentials credentials)
            : base(baseAddress, credentials)
        { 
        }

        public void Add(string partitionKey, string term, string posting, int docFreq)
        {
            Index index = new Index();
            index.PartitionKey = partitionKey;
            index.RowKey = term;
            index.posting = posting;
            index.docFreq = docFreq;

            this.AddObject("index", index);
        }
    }
}
